package com.im.service.controller;

import cn.dev33.satoken.stp.SaTokenInfo;
import com.im.service.common.Result;
import com.im.service.domain.dto.LoginDTO;
import com.im.service.service.ImLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author liuzhiqiang
 */
@RestController
@RequestMapping("/login")
@CrossOrigin
@Slf4j
@Api(tags = "登录")
public class ImLoginController {

    @Autowired
    private ImLoginService loginService;

    @PostMapping
    @ApiOperation(value = "登录")
    public Result<SaTokenInfo> login(@RequestBody LoginDTO loginDTO) {
        return loginService.login(loginDTO);
    }
}
